package com.zj.z11select.utils;

import java.util.Base64;

/**
 * @Description base64 加解密 工具类
 * @Author ZHOUJIEStart
 * @Date 2021-08-03 21:49
 * @Email z-houjie@qq.com / zkanan21@gmail.com
 */
public class Base64Utils {

    /**
     * 加密
     * @param msg
     * @return
     */
    public static String encode(String msg){
        return Base64.getEncoder().encodeToString(msg.getBytes());
    }

    /**
     * 解密
     * @param msg
     * @return
     */
    public static String decode(String msg){
        return new String(Base64.getDecoder().decode(msg));
    }
}
